package com.ftg.learn.controller;

import com.ftg.learn.service.SysUserService;
import com.ftg.learn.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 用户认证中心
 *
 * @author 布衣
 */
@RestController
@RequestMapping("/usercenter")
@Api(tags = "用户认证中心")
public class UserCenterController {

    @Resource
    private SysUserService sysUserService;

    /**
     * 登录
     * @param username 用户名
     * @param password 密码
     * @return R<String>
     */
    @PostMapping("/login")
    @ApiOperation(value = "登录")
    public R<String> login(
        @RequestParam(value = "username") String username,
        @RequestParam(value = "password") String password
    ) {
        return sysUserService.login(username, password);
    }
//
//    @RequestMapping("/logout")
//    public String logout() {
//        return "退出成功";
//    }
//
//    @RequestMapping("/userInfo")
//    public String userInfo(){
//        return "用户信息";
//    }
//
//    @RequestMapping("/register")
//    public String register() {
//        return "注册成功";
//    }
//
//    @RequestMapping("/forget")
//    public String forget() {
//        return "忘记密码成功";
//    }
//
//    @RequestMapping("/reset")
//    public String reset() {
//        return "重置密码成功";
//    }
//


}
